Skip to content

Conversation

@Kiisu-Master
Copy link
Contributor

@Kiisu-Master Kiisu-Master commented Nov 1, 2025

fixes #64296
Note: I have no idea if how i did things is correct, this is my second time working with c++ and godot source.
I just tried to follow how things were done in the surrounding code.

Tested on latest kwin plasma 6.5.1

@Kiisu-Master
Copy link
Contributor Author

It seems the commit hash in thirdparty/README.md for wayland-protocols didn't get updated here ae74c0c

I just copied the pointer warp xml file from the main branch, should i include the one from 1.45 if its different?

@deralmas
Copy link
Contributor

deralmas commented Nov 2, 2025

I just copied the pointer warp xml file from the main branch, should i include the one from 1.45 if its different?

Yea, as wayland-protocols is at that version. If the protocol is not available there feel free to make a PR updating it.

Copied this code from pointer_set_hint, should there be a function to remove the duplicate scaling code?

Nah, it's done in only two places now and it's something that we should generally not do, as pointed out by the big comment.

What about the comment?

Not sure tbh. I'll be fair, in these cases I just keep them there, duplicated. You never know if the other half will be there by the time you'll need to read that comment again :P

@Kiisu-Master Kiisu-Master force-pushed the wl_pointer_warp branch 2 times, most recently from e95791a to 1d153b6 Compare November 3, 2025 20:27
@Kiisu-Master Kiisu-Master marked this pull request as ready for review November 3, 2025 20:42
@Kiisu-Master Kiisu-Master requested review from a team as code owners November 3, 2025 20:42
return;
}

struct wl_surface *surface = window_get_wl_surface(p_ss->pointer_data.last_pointed_id);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats the difference between last_pointed_id and pointed_id? I just noticed back in pointer_warp it uses pointed_id to get the window...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm doesn't seem to make a difference. Ill just make it use pointed_id here too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pointed_id is the current pointed window. It will be set to INVALID_WINDOW_ID, while last_pointed_id never gets cleared.

@Kiisu-Master Kiisu-Master force-pushed the wl_pointer_warp branch 2 times, most recently from 8850dc3 to 89faf8f Compare November 4, 2025 13:59
@Kiisu-Master
Copy link
Contributor Author

I keep forgetting to add changed files before committing

@YeldhamDev
Copy link
Member

This is not working at all on my end: Fedora Kinoite 42 / KDE Plasma 6.5.1

@Kiisu-Master
Copy link
Contributor Author

How did you test it?
For me it's working with the same plasma version... im on arch.
Just have to make sure that godot is actually using wayland.

Heres a test project i made for this:
PointerWarp.zip

Copy link
Member

@YeldhamDev YeldhamDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. I had prefer_wayland enabled and forgot that it's an editor setting. It works now.

CC @bruvzg to check the code.

Copy link
Contributor

@deralmas deralmas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to try it on my machine but it looks like sway does not implement it yet. Code looks fine except for a small nitpick.


if (name == registry->wp_pointer_warp_name) {
if (registry->wp_pointer_warp) {
wp_pointer_warp_v1_destroy(registry->wp_pointer_warp);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to also destroy it WaylandThread::destroy().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what you mean

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you have to destroy it there too? I'll add this tomorrow

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea it's kinda annoying. I've considered making it automatic but I feel like it would make everything more complex for little gain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

modifiying mouse position doesn't work (Linux Wayland)

4 participants